//table头信息 不变
var cd_columnData = [

    {"Width": "9%", "ColumnName": "客户ID"},
    {"Width": "9%", "ColumnName": "客户名称"},
    {"Width": "8%", "ColumnName": "责任人"},
    {"Width": "9%", "ColumnName": "客户类型"},
    {"Width": "9%", "ColumnName": "客户等级"},
    {"Width": "8%", "ColumnName": "联系人"},
    {"Width": "8%", "ColumnName": "手机号"},
    {"Width": "9%", "ColumnName": "身份证"},
    {"Width": "7%", "ColumnName": "来源"},
    {"Width": "9%", "ColumnName": "所属行业"},
    {"Width": "10%", "ColumnName": "录入时间"}
];

//用户管理分页函数
var gotoPage = function (index) {
    var url = webPath + "/crm/1";
    //TODO FORm val()
    //var postData = {
    //    "pageSize": pageSize, "pageNumber": index,
    //    "customerName": customerName, "recordTime": recordTime, "nextContectTime": nextContectTime
    //};
    var postData = $("#m-customerForm").serialize();
    var options = {"passArguments": index}
    postAjax(url, postData, gotoPageSuccess, options);
};

var gotoPageSuccess = function (result, passArguments) {
    //TODO remove
    result = '{"totalNumber":3,"list":[]}';
    var columnList = ["customerName", "recordTime", "nextCallTime", "contectMan", "phoneNumber", "recordContent"];
    cleanTableAndPage("customerDistributionTable");
    var jsonData = $.parseJSON(result);
    //画table
    $("#customerDistributionTable").MakeTable(true, cd_columnData, jsonData.list, tableClass, columnList);
    //画分页
    $("#customerDistributionTable").after(comPagination(passArguments, pageSize, jsonData.totalNumber, "gotoPage", "customerDistributionP"));
}

//查询按钮行为 TODO Change
//$('#searchCRecordBtn').click(function () {
//    gotoPage(1);
//});

//获取id 方便提交 TODO Change
//var getContectRecordId = function (that) {
//    return that.closest("tr").find("td div")[1].innerHTML;
//}